﻿/*------------------------------------------------
// File Description: Outbound DataBase Entity
// Author:			 汪亮
// Create Time:		 2020-05-11 17:41:34
//------------------------------------------------*/

using System;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace IOA.MES.DataAccess.Entity
{
    /// <summary>
    /// 出库任务
    /// </summary>
    [Table(nameof(Outbound))]
    public class Outbound : BaseEntity
    {
        private string _outboundTypeNo = string.Empty;
        private string _outboundNo = string.Empty;
        private string _warehouseCode = string.Empty;
        private string _warehouseName = string.Empty;
        private string _areaCode = string.Empty;
        private string _areaName = string.Empty;
        private string _location = string.Empty;
        private string _cabinetNo;

        #region Public Property

        ///<Summary>
        /// 出库类型
        ///</Summary>
        public Enum.OutboundType OutboundType { get; set; }

        ///<Summary>
        /// 出库类型ID
        ///</Summary>
        public int OutboundTypeId { get; set; }

        ///<Summary>
        /// 出库类型号
        ///</Summary>
        public string OutboundTypeNo
        {
            get { return string.IsNullOrWhiteSpace(_outboundTypeNo) ? string.Empty : _outboundTypeNo; }
            set { _outboundTypeNo = value; }
        }

        ///<Summary>
        /// 出库单号
        ///</Summary>
        public string OutboundNo
        {
            get { return string.IsNullOrWhiteSpace(_outboundNo) ? string.Empty : _outboundNo; }
            set { _outboundNo = value; }
        }

        ///<Summary>
        /// 柜号
        ///</Summary>
        public string CabinetNo
        {
            get { return string.IsNullOrWhiteSpace(_cabinetNo) ? string.Empty : _cabinetNo; }
            set { _cabinetNo = value; }
        }

        ///<Summary>
        /// 仓库代码
        ///</Summary>
        public string WarehouseCode
        {
            get { return string.IsNullOrWhiteSpace(_warehouseCode) ? string.Empty : _warehouseCode; }
            set { _warehouseCode = value; }
        }

        ///<Summary>
        /// 仓库名称
        ///</Summary>
        public string WarehouseName
        {
            get { return string.IsNullOrWhiteSpace(_warehouseName) ? string.Empty : _warehouseName; }
            set { _warehouseName = value; }
        }

        ///<Summary>
        /// 出库数量
        ///</Summary>
        public decimal Quantity { get; set; }

        ///<Summary>
        /// 已出库数量
        ///</Summary>
        public decimal OutboundedQuantity { get; set; }

        ///<Summary>
        /// 状态
        ///</Summary>
        public Enum.OutboundStatus Status { get; set; }

        ///<Summary>
        /// 出库人
        ///</Summary>
        public int OutboundBy { get; set; }

        ///<Summary>
        /// 出库时间
        ///</Summary>
        public DateTime? OutboundTime { get; set; }
        #endregion
    }

    public partial class MESContext
    {
        /// <summary>
        /// 出库任务
        /// </summary>
        public virtual DbSet<Outbound> Outbounds { get; set; }
    }
}